// pages/opt_user_admin/opt_page/hospital_base_info/charge_rule/charge_rule.js
var app = getApp()
//常量数据配置
var ConstantData = require('../../../../../../common/constant_data.js')
Page({

  /**
   * 页面的初始数据
   */
  data: {
    deposit: 0,
    ruleList: []
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    var that = this;

    wx.showLoading({
      title: '加载中...',
      mask: true
    });
    var typeId = options.typeId;
    var hospitalName = options.hospitalName;
    var ali_mini_stat = options.ali_mini_stat;
    var ali_nodeposit_stat = options.ali_nodeposit_stat;
    that.setData({
      hospitalName: hospitalName,
      ali_mini_stat: ali_mini_stat,
      ali_nodeposit_stat: ali_nodeposit_stat
    })

    app.executeRequest(function (header) {
      wx.request({
        url: ConstantData.CONSTATNT_DATA.BASE_URL + '/lease_admin/hospital_info/charge_info',
        data: {
          tid: typeId
        },
        header: header,
        success: function (res) {
          getApp().hideLoading();
          console.log("chargeInfo---->", res);
          var deposit = res.data.deposit;
          var ruleList = res.data.ruleList;

          that.setData({
            deposit: deposit,
            ruleList: ruleList
          })
        }
      })
    });  

  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})